﻿using Microsoft.SharePoint;
using RoketSolutions.SP2010.ImageRotatorWebPart.Constants;
using RoketSolutions.SP2010.ImageRotatorWebPart.Data.Entities;
using RoketSolutions.SP2010.ImageRotatorWebPart.Data.Repositories.Interfaces;
using RoketSolutions.SP2010.Infrostructure.Data.Repositories;

namespace RoketSolutions.SP2010.ImageRotatorWebPart.Data.Repositories
{
    public class ImageRotatorRepository : SPRepository<ImageRotatorItem>, IImageRotatorRepository
    {
        protected override string ListName
        {
            get { return Lists.ImageRotator; }
        }

        protected override ImageRotatorItem Wrap(SPListItem item)
        {
            return new ImageRotatorItem(item);
        }

        protected override SPListItem Unwrap(ImageRotatorItem entity)
        {
            return entity.Item;
        }
    }
}